function dateFormat(date, formString) {
    var year = date.getFullYear();
    var formString = formString.replace(/(Y+)/, function ($0, $1) {
        return year.toString().substr(4 - $1.length)
    })

    var month = date.getMonth() + 1;
    var formString = formString.replace(/(M+)/, function () {
        if (month >= 10) {
            return month.toString();
        }
        else {
            return 0 + month.toString();
        }
    })

    var day = date.getDate();
    var formString = formString.replace(/(D+)/, function () {
        if (day >= 10) {
            return day.toString();
        }
        else {
            return 0 + day.toString();
        }
    })

    var hour = date.getHours();
    var formString = formString.replace(/(h+)/, function () {
        if (hour >= 10) {
            return hour.toString();
        }
        else {
            return 0 + hour.toString();
        }
    })

    var minute = date.getMinutes();
    var formString = formString.replace(/(mm+)/, function () {
        if (minute >= 10) {
            return minute.toString();
        }
        else {
            return 0 + minute.toString();
        }
    })

    var second = date.getSeconds();
    var formString = formString.replace(/(ss+)/, function () {
        if (second >= 10) {
            return second.toString();
        }
        else {
            return 0 + second.toString();
        }
    })

    return formString;
}

let date = new Date();

module.exports = () => {
    return dateFormat(date, 'YYYY-MM-DD hh:mm:ss')
}